import request from '@/utils/request'
import {baseJava, baseNode, basePublic} from "@/api/base";

export default class FileList {
  constructor() {
  }

  // 条件查询，多条件查询，分页查询
  getFileList(query) {
    return request({
      url: `${baseJava}/fileMsg/`,
      method: 'get',
      params: query
    })
  }

  // 根据id查询
  getByFileId(id) {
    return request({
      url: `${baseJava}/fileMsg/${id}`,
      method: 'get',
      params: {id}
    })
  }

  // 增加单个
  addFileList(data) {
    return request({
      url: `${baseJava}/fileMsg/`,
      method: 'post',
      data
    })
  }

  // 删除单个
  deleteByFileId(data) {
    return request({
      url: `${baseJava}/fileMsg/${data.id}`,
      method: 'delete',
      params: data
    })
  }

  // 删除单个
  deleteByUploadFileId(data) {
    return request({
      url: `${baseJava}/file`,
      method: 'delete',
      params: data
    })
  }

  // 修改单个或
  updateByFileId(data) {
    return request({
      url: `${baseJava}/fileMsg/${data.id}`,
      method: 'put',
      data
    })
  }
}

